package com.imooc.util;

import java.util.Random;

/**
 * 生成唯一的主键
 * @author liuhuan
 * @date 2018/7/7 09:49
 * @description
 */
public class KeyUtil {
    /**
     * 生成唯一的主键
     * @return
     */
    public static synchronized String genUniqueKey(){
        Random random=new Random();
        Integer number=random.nextInt(900000)+100000;
        return System.currentTimeMillis()+String.valueOf(number);
    }
}
